<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>资产信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});

		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/inventory/hostInventory/">主机列表</a></li>
		<li class="active"><a href="${ctx}/inventory/hostInventory/form?id=${hostInventory.id}">添加新主机</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="hostInventory" action="${ctx}/inventory/hostInventory/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<c:choose>
			<c:when test="${not empty hostInventory.id}">
				<form:hidden path="hostid"/>
			</c:when>
			<c:otherwise>
				<form:hidden path="hostid" value="0"/>
			</c:otherwise>
		</c:choose>
	<fieldset>
		<legend>主机基本信息</legend>
		<table>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">主机是否监控：</label>
						<div class="controls">
							<form:select path="inventoryMode" class="input-medium">
								<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">分类：</label>
						<div class="controls">
							<form:select path="type" class="input-medium">
								<form:options items="${fns:getDictList('host_inventory_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">分类详情：</label>
						<div class="controls">
							<form:input path="typeFull" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">主机名（监控标识）：</label>
						<div class="controls">
							<form:input path="name" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">别名：</label>
						<div class="controls">
							<form:input path="alias" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">资产标签：</label>
						<div class="controls">
							<form:input path="assetTag" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">硬件：</label>
						<div class="controls">
							<form:input path="hardware" htmlEscape="false" maxlength="255" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">硬件详情：</label>
						<div class="controls">
							<form:input path="hardwareFull" htmlEscape="false" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">联系信息：</label>
						<div class="controls">
							<form:input path="contact" htmlEscape="false" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">软件：</label>
						<div class="controls">
							<form:input path="software" htmlEscape="false" maxlength="255" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">软件详情：</label>
						<div class="controls">
							<form:input path="softwareFull" htmlEscape="false" maxlength="255" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">服务编码：</label>
						<div class="controls">
							<form:input path="notes" htmlEscape="false" maxlength="255" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">型号：</label>
						<div class="controls">
							<form:input path="model" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">供应商：</label>
						<div class="controls">
							<form:input path="vendor" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">合同：</label>
						<div class="controls">
							<form:input path="contractNumber" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">IP(外网)：</label>
						<div class="controls">
							<form:input path="tag" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">IP(内网)：</label>
						<div class="controls">
							<form:input path="siteRack" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">端口信息：</label>
						<div class="controls">
							<form:input path="siteNotes" htmlEscape="false" maxlength="64" class="required"/>
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div class="control-group">
						<label class="control-label">购买日期：</label>
						<div class="controls">
							<form:input path="dateHwPurchase"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"   class="input-small Wdate"  />
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">上架日期：</label>
						<div class="controls">
							<form:input path="dateHwInstall"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"   class="input-small Wdate"  />
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
				<td>
					<div class="control-group">
						<label class="control-label">质保日期：</label>
						<div class="controls">
							<form:input path="dateHwExpiry"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"   class="input-small Wdate"  />
							<span class="help-inline"><font color="red">*</font> </span>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td colspan="2">

				</td>
				<td >

					<div class="control-group">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="下一步"/>&nbsp;
						<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
					</div>

				</td>
			</tr>
		</table>
	</fieldset>
	</form:form>
</body>
</html>